package jchat.model;

import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;

public class person {
	public String name;
	public String mobile_no;
	byte[] image;
  public person(String name,String mobile)
  {
	  this.name=name;
	  this.mobile_no=mobile;
	 // this.image=image;
	  
  }
  public person() {
	// TODO Auto-generated constructor stub
}
public void setname(String name)
  {
	 this.name=name;  
  }
  public String getname()
  {
	  return name;
  }
  public void setmobile_no(String moile_no)
  {
	  this.mobile_no=moile_no;
	  
  }
  public String getmobile_no()
  {
	  PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
		
	  PhoneNumber swissNumberProto;  
	  
	  try {
			
			swissNumberProto = phoneUtil.parse(mobile_no, "IN");
			//secondnumber=phoneUtil.parse(list.get(2).getPhone(), "IN");
			
			String type=phoneUtil.getNumberType(swissNumberProto).toString();
//			String region=phoneUtil.;
	      // System.out.println(type);
		//	System.out.println(region);
			 
			 //System.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.INTERNATIONAL));
   		// Produces "044 668 18 00"
   		//System.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.NATIONAL));
   		// Produces "+41446681800"
   		mobile_no=phoneUtil.format(swissNumberProto, PhoneNumberFormat.E164);
   		String numbfer=phoneUtil.format(swissNumberProto, PhoneNumberFormat.RFC3966);
   		//System.out.println(jdjd);
   		//System.out.println(numbfer);
   		
		} catch (NumberParseException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		return mobile_no;
  }
  public void setimge(byte[] image)
  {
	  this.image=image;
  }
  public byte[] getimage()
  {
	  return image;
  }
}
